package com.boc.langxiang.ui.adapter.me;

import android.content.Context;
import android.widget.ImageView;

import com.boc.langxiang.R;
import com.boc.langxiang.entity.response.CanyuListBean;
import com.boc.langxiang.manager.PicassoImageLoader;
import com.boc.langxiang.util.StringUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MyExerciseJoinFragmentRVAdapter extends BaseQuickAdapter<CanyuListBean> {

    private boolean mVisible;

    public MyExerciseJoinFragmentRVAdapter(Context context, List<CanyuListBean> data) {
        super(R.layout.item_me_myexercise_join, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CanyuListBean item) {
        //   helper.setVisible(R.id.fralayout_me_orders_exercises,mVisible);
        helper.setText(R.id.tv_me_myexercise_wantnum, "想参与\t" + item.getCount_be_canyu())
                .setText(R.id.tv_me_myexercise_joinnum, "参与\t" + item.getCount_canyu())
                .setText(R.id.tv_me_myexercise_title, StringUtil.isEmpty(item.getTitle()) ? "" : item.getTitle());

        PicassoImageLoader.getInstance().displayUrlImage(mContext, item.getPhotourl()
                , (ImageView) helper.getView(R.id.img_iv));
    }


    public void setDeleteIconVisiblity(boolean visible) {
        this.mVisible = visible;
        notifyDataSetChanged();
    }
}
